

{% block content %}

<p>You can rate for the personal stock recommendation here</p>




{% if user.is_authenticated %}

         <table >

      <tr><th>User</th><th>Rating</th></tr>

		 	        {% for rec in perstockrec %}
		 	        <tr>
		 	        <td>{{user}}</td>
		 	        <td>{{rec.type}}</td>
		 	        <td>{{rec.text}}</td>
		 	        </tr>
		 	        {% endfor %}
		 </table>
           <table>
                  <tr>
                  <td>There are {{count}} user rated the comment</td>
                  </tr>
                  <tr>
                  <td>Total Rating is {{sum}}</td>
                  </tr>
                  <tr>
                  <td>Average Rating is {{avg_rat}}</td>
                  </tr>
                  
          <table>

		 {% if has_rated %}
		 User {{ has_rated.user }}	already voted: {{ has_rated.rating }}
		 {% else %}
		 you can rate the comment here
			<form action="" method="POST">
				{{ form.as_ul }}
				<input type="submit" name="submit" value="Rate" />
			</form>
			{% endif %}
	  {% endif %}



{%endblock%}